﻿<!--_meta 作为公共模版分离出去-->
{include file="public/meta" /}
<!--/meta 作为公共模版分离出去-->
<title>会员列表 - 会员管理</title>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        会员管理
        <span class="c-gray en">/</span>
        会员列表
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <form class="layui-form layui-form-pane" action="{:url('index')}" method="get">
                <div class="panel-body">
                    <div class="text-c"> 日期范围：
                        <input type="text" name="begin_time" value="{$begin_time}" id="search-datetime-start" class="input-text datetimepicker-input"
                               style="width:120px;">
                        -
                        <input type="text" name="end_time" value="{$end_time}" id="search-datetime-end" class="input-text datetimepicker-input"
                               style="width:120px;">
                        <input type="text" class="input-text" style="width:100px" value="{$nickname}" placeholder="会员名称" name="nickname">
                        <input type="text" class="input-text" style="width:100px" value="{$country}" placeholder="国家" name="country">
                        <input type="text" class="input-text" style="width:100px" value="{$province}" placeholder="省份" name="province">
                        <span class="select-box" style="width:150px">
							<select class="select" name="device_type" size="1">
								<option value="" selected>选择</option>
								<option value="苹果" {if("苹果"==$device_type)}selected {/if}>苹果</option>
								<option value="安卓" {if("安卓"==$device_type)}selected {/if}>安卓</option>
								<option value="小程序" {if("小程序"==$device_type)}selected {/if}>小程序</option>
                                {/foreach}
							</select>
							</span>
                            <span class="select-box" style="width:150px">
                                <select class="select" name="is_vip" size="1">
                                    <option value="" selected>选择</option>
                                    <option value="1" {if(1==$is_vip)}selected {/if}>普通会员</option>
                                    <option value="2" {if(2==$is_vip)}selected {/if}>vip</option>
                                    {/foreach}
                                </select>
                                </span>
                        <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i>
                            搜用户
                        </button>
                    </div>
                </div>
            </form>
        </div>
        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <span class="f-r">共有数据：<strong>{$count}</strong> 条</span>
                </div>
                <div class="clearfix mt-20">
                    <table class="table table-border table-bordered table-hover table-bg table-sort">
                        <thead>
                        <tr class="text-c">
                            <th width="25"><input type="checkbox" name="" value=""></th>
                            <th width="80">ID</th>
                            <th width="100">昵称</th>
                            <th width="100">是否vip</th>
                            <th width="100">手机号</th>
                            <th width="100">邮箱</th>
                            <th width="100">设备</th>
                            <th width="100">注册方式</th>
                            <th width="90">国家</th>
                            <th width="90">省份</th>
                            <th width="90">城市</th>
                            <th width="130">注册时间</th>
                            <th width="100">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="model" id="vo"}
                        <tr class="text-c">
                            <td><input type="checkbox" value="1" name=""></td>
                            <td>{$vo.id}</td>
                            <td><u style="cursor:pointer" class="text-primary"
                                   onclick="member_show('张三','{:url(\'user/show\',[\'id\'=>$vo.id])}')">{$vo.nickname}</u>
                            </td>
                            <td>{$vo.is_vip}</td>
                            <td>{$vo.phone}</td>
                            <td>{$vo.email}</td>
                            <td>{$vo.device_type}</td>
                            <td>{$vo.register_type}</td>
                            <td>{$vo.country}</td>
                            <td>{$vo.province}</td>
                            <td>{$vo.city}</td>
                            <td>{$vo.create_time|date="Y-m-d H:i:s"}</td>
                            <td class="td-manage">
                                {if condition="$vo.status==1"}
                                <a style="text-decoration:none" onClick="product_stop(this,{$vo.id})"
                                   href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a>
                                {else/}
                                <a style="text-decoration:none" onClick="product_start(this,{$vo.id})"
                                   href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe6e1;</i></a>
                                {/if}
                                <a title="编辑" href="javascript:;" onclick="change_password('赠送积分','{:url('user/add_integral',['id'=>$vo.id])}')"
                                   class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   onClick="change_password('修改密码','change-password.html','10001')" href="javascript:;"
                                   title="修改密码"><i class="Hui-iconfont">&#xe63f;</i></a>
                                <a title="删除" href="javascript:;" onclick="product_del(this,{$vo.id})" class="ml-5"
                                   style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$page|RAW}
                </div>
            </div>
        </div>
    </article>
</div>
<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/static/business/js/main.js"></script>
<script type="text/javascript">
    $(function () {
        runDatetimePicker();
        // 全选 页面调用
    });

    /*产品-下架*/
    function product_stop(obj, id) {
        layer.confirm('确认要封禁此用户吗？封禁时效7天', function (index) {
            $.ajax({
                url: "user/status",
                type: "post",
                data: {
                    id: id,
                    status: 2,
                },
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg('已封禁', {
                            icon: 5,
                            time: 1000 //2秒关闭（如果不配置，默认是3秒）
                        }, function () {
                            //do something
                            location.reload();
                            // parent.layer.close(index);
                        });
                    } else {
                        layer.msg('封禁失败', {icon: 2, time: 1000});
                    }
                }
            })
        });
    }

    /*产品-发布*/
    function product_start(obj, id) {
        layer.confirm('确认要恢复此用户吗？', function (index) {
            $.ajax({
                url: "/user/status",
                type: "post",
                data: {
                    id: id,
                    status: 1,
                },
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg('已恢复', {
                            icon: 6,
                            time: 1000 //2秒关闭（如果不配置，默认是3秒）
                        }, function () {
                            //do something
                            location.reload();
                            // parent.layer.close(index);
                        });
                    } else {
                        layer.msg('恢复失败', {icon: 2, time: 1000});
                    }
                }
            })
        });
    }

    /*产品-发布*/
    function product_del(obj, id) {
        layer.confirm('确认要封停此用户吗？', function (index) {
            $.ajax({
                url: "/admin/user/status",
                type: "post",
                data: {
                    id: id,
                    status: 3,
                },
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg('已封停', {
                            icon: 6,
                            time: 1000 //2秒关闭（如果不配置，默认是3秒）
                        }, function () {
                            //do something
                            location.reload();
                            // parent.layer.close(index);
                        });
                    } else {
                        layer.msg('封停失败', {icon: 2, time: 1000});
                    }
                }
            })
        });
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
